import React from "react";

class TodoItem extends React.Component {

  constructor(props){
    super(props);
    this.handleDelete = this.handleDelete.bind(this);
  }

  handleDelete(){
    let index = this.props.index;
    this.props.delete(index);
  }
  
  render() {
    const { content } = this.props;
    return (
      <div onClick={this.handleDelete}>{content}</div>
    );
  }
}

export default TodoItem;